package vcsn.entities;

public class RemoveKeyWordOperation extends ConflictOperation {
	private String keyword;
	private int firstParameterStartingPosition;
	private int lastParameterEndingPosition;
	
	public String getKeyword(){return keyword;}
	public int getFirstParameterStartingPosition(){return firstParameterStartingPosition;}
	public int getLastParameterEndingPosition(){return lastParameterEndingPosition;}
	public void setKeyword(String value){keyword = value;}
	public void setFirstParameterStartingPosition(int value){firstParameterStartingPosition = value;}
	public void setLastParameterEndingPosition(int value){lastParameterEndingPosition = value;}
	
	public RemoveKeyWordOperation(String key){
		super();
		setKeyword(key);
	}
	
	public RemoveKeyWordOperation(String key, String appendComment){
		super(appendComment);
		setKeyword(key);
	}
	@Override
	public StringBuilder change(StringBuilder outputBuffer) {
		// TODO Auto-generated method stub
		int pos = outputBuffer.lastIndexOf(keyword);
		int endPos = pos + keyword.length();
		outputBuffer.replace(pos, endPos, "");
		return outputBuffer;
	}

}
